<head><title>Please wait ...</title></head>
<?php
$con=mysql_connect("localhost","William");

if (!$con){
	die("MySQL Error " . mysql_error());
}
mysql_select_db("osa", $con);
$success=false;
$UID=$_REQUEST["UID"];
$query=mysql_query("SELECT * FROM onlineuser WHERE UID=$UID",$con);
if(!$query) die("MySQL Error " . mysql_error());
$row=mysql_fetch_array($query);
if(!$row) die("Internal Error: UID $UID not found!");
$query=mysql_query("DELETE FROM onlineuser WHERE UID=$UID", $con);
if(!$query) die("MySQL Error " . mysql_error());
$success=true;
if($success){
	echo "<body onLoad='self.location.href=\"/index.html\"'>Logout success...Redirecting to login page ...</body>";
}
mysql_close($con);
?>
